/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.eclipse.persistence.annotations.IdValidation;
import org.eclipse.persistence.annotations.PrimaryKey;

/**
 *
 * @author alumno
 */
@Embeddable
public class PrecioPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "MOD_COD")
    private int modCod;
    @Basic(optional = false)
    @Column(name = "ALUT_COD")
    private int alutCod;
    @Basic(optional = false)
    @Column(name = "PREC_COD")
    private int precCod;

    public PrecioPK() {
    }

    public PrecioPK(int modCod, int alutCod, int precCod) {
        this.modCod = modCod;
        this.alutCod = alutCod;
        this.precCod = precCod;
    }

    public int getModCod() {
        return modCod;
    }

    public void setModCod(int modCod) {
        this.modCod = modCod;
    }

    public int getAlutCod() {
        return alutCod;
    }

    public void setAlutCod(int alutCod) {
        this.alutCod = alutCod;
    }

    public int getPrecCod() {
        return precCod;
    }

    public void setPrecCod(int precCod) {
        this.precCod = precCod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) modCod;
        hash += (int) alutCod;
        hash += (int) precCod;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PrecioPK)) {
            return false;
        }
        PrecioPK other = (PrecioPK) object;
        if (this.modCod != other.modCod) {
            return false;
        }
        if (this.alutCod != other.alutCod) {
            return false;
        }
        if (this.precCod != other.precCod) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.PrecioPK[ modCod=" + modCod + ", alutCod=" + alutCod + ", precCod=" + precCod + " ]";
    }
    
}
